//
//  AccountViewModel.h
//  王雷Sinoweibo
//
//  Created by wanglei on 16/11/2.
//  Copyright © 2016年 wanglei. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserAccount.h"
#import "HTTPClient.h"

typedef void (^success)(BOOL isSuccess);

@interface AccountViewModel : NSObject


//一直报错,错误信息为-[UserAccount access_token]: message sent to deallocated instance,原来是

@property(nonatomic,strong) UserAccount *userAccount;

@property(nonatomic,assign) BOOL userLogin;

@property(nonatomic,copy,readwrite) NSString *access_token;

@property(nonatomic,copy,readwrite) NSString *userName;

@property(nonatomic,copy,readwrite) NSURL *headImageURL;

- (BOOL)loadAccessToken:(NSString *)code isSuccess:(success)success;

- (void)loadUserInfoAccess:(UserAccount *)useraccount isSuccess:(success)success;

-(instancetype)init;

+(instancetype)sharedAccountModel;

//-(id)copyWithZone:(NSZone *)zone;

@end
